<template>
  <view>

    <view class="hotel-list">
      <view v-for="(item, index) in dataList" :key="index" class="hotel-item" @click="goDetails(item)">
        <image class="image" :src="item.cover_img"></image>
        <view class="right-info">
          <view class="top-info">
			  <view class="name">{{ item.name }}</view>
			  <view class="distance">距您{{item.dis}}Km</view>
			  <view class="tags">
			    <view class="tag" v-for="(sub, idx) in item.intro_list" :key="idx">{{ sub }}</view>
			  </view>
		  </view>
          <view class="price">
            <text class="unit"></text>
            <text class="value">￥{{ item.start_price }}</text>
            <text class="after">起</text>
          </view>
        </view>
      </view>
    </view>
  </view>
</template>

<script>
import dataList from "@/mixins/dataList";
import {getHotelList} from "@/api/2_store";

export default {
  mixins: [dataList],
  data() {
    return {};
  },
  onLoad(options) {
	let from = options.from
	this.setDataListPar({from: from})
    this.setDataListReq(getHotelList)
    this.getDataList()
  },
  methods: {
    goDetails(item) {
      uni.navigateTo({
        url: `/pages/2_development/hotel/details?id=${item.id}`
      })
    }
  }
}
</script>

<style lang="scss">
@import './style.scss';

.hotel-list{
  padding-bottom: 0;  
  padding-bottom: constant(safe-area-inset-bottom);  
  padding-bottom: env(safe-area-inset-bottom); 
}

.hotel-item {
  padding-top: 28rpx;
  padding-left: 24rpx;
  display: flex;
  padding-bottom: 28rpx;
  background-color: #fff;
  border-bottom: 1px solid #eee;

  .image {
    width: 167rpx;
    height: 167rpx;
    margin-right: 24rpx;
    border-radius: 5px;
  }
  .right-info{
	  flex: 1;
	  display: flex;
	  flex-direction: column;
	  justify-content: space-between;
	  margin-right: 20rpx;
  }

  .name {
    font-weight: bold;
    font-size: 30rpx;
    line-height: 1;
    color: #0b0b0b;
	margin-top: 6rpx;
  }

  .distance {
    font-size: 22rpx;
    color: #111;
    margin-top: 9rpx;
  }

  .tags {
    display: flex;
    margin-top: 10rpx;
  }

  .tag {
    height: 36rpx;
    border-radius: 6rpx;
    background: #fff;
    border: 1px solid #80bffa;
    font-size: 22rpx;
    // line-height: 34rpx;
    color: #80bffa;
    padding: 0 4rpx;
    margin-right: 20rpx;
	display: flex;
	flex-direction: row;
	align-items: center;
	padding: 0px 4rpx;
  }

  .price {
    display: flex;
    align-items: flex-end;
    line-height: 1;
	margin-top:10rpx;

    .unit {
      font-size: 24rpx;
      color: #D82C2C;
    }

    .value {
      font-size: 32rpx;
      color: #D82C2C;
    }

    .after {
      color: #999999;
      font-size: 21rpx;
    }
  }
}
</style>
